#ifndef _PLAYER_H_
#define _PLAYER_H_

#include "Globals.h"
#include "Entity.h"

#include <list>

class Player : public Entity{
private:
	// Last enum item represents number of items when cast to an int - allows states
	// to be indexed into an array
	typedef enum{
		STANDING, WALKING, FALLING, KICKING, PUNCHING,
		JUMPING, JUMP_PUNCHING, JUMP_KICKING,
		CROUCHING, CROUCH_PUNCHING, CROUCH_KICKING,
		RECOILING, DEAD,
		NUM_PLAYER_STATES
	} PlayerState;

	Image* images[NUM_PLAYER_STATES];
	Image* projectileImage;

    PlayerState state;

    bool crouching, attacking;

	std::list<Entity*> grabbingEnemies;

	void shakeGrabbers();

	int score;

protected:
    void tick();

    Image* getCurrentImage();

public:
    Player();
	virtual ~Player();

    void jump();

	void addGrabbingEnemy(Entity* e){ grabbingEnemies.push_back(e); }
	void removeGrabbingEnemy(Entity* e){ grabbingEnemies.remove(e); }

	void addScore(int score){ this->score += score; }
	int getScore(){ return score; }
};

#endif
